package Hot100.Easy.LC283;

public class LC283 {
    public static void main(String[] args) {

    }
    public void moveZeroes(int[] nums){
        int left = 0, right = 0;
        int n = nums.length;
        while(right < n){
            if(nums[right] != 0){
                swap(nums, left, right);
                left++;
            }
            right++;
        }
    }
    private void swap(int[] nums, int left, int right){
        int temp = nums[left];
        nums[left] = nums[right];
        nums[right] = temp;
    }

}
